package 第十三届蓝桥杯省赛模拟赛; /**
 * @author Wcy
 * @Date 2022/3/24 18:14
 */

/**
 * AAAAAAABABBAABABABAAAAAAA
 * 　　ABBBBBABBAABBBBBABABBBBBA
 * 　　ABAAABABBBABAABBBBABAAABA
 * 　　ABAAABABBBBBAABAABABAAABA
 * 　　ABAAABABBABABBABABABAAABA
 * 　　ABBBBBABBBABAABBBBABBBBBA
 * 　　AAAAAAABABABABABABAAAAAAA
 * 　　BBBBBBBBABAABABBBBBBBBBBB
 * 　　AABAABABBAAABBAAABABBBBBA
 * 　　ABBABABBBABBAAAABBBBAAAAB
 * 　　BBBBAAABABAABABAABBBAABBA
 * 　　BBAABABABAAAABBBAABBAAAAA
 * 　　ABABBBABAABAABABABABBBBBA
 * 　　AAAABBBBBABBBBAAABBBABBAB
 * 　　AABAABAAABAAABAABABABAAAA
 * 　　ABBBBBBBBABABBBBABAABBABA
 * 　　ABBBAAABAAABBBAAAAAAABAAB
 * 　　BBBBBBBBABBAAABAABBBABBAB
 * 　　AAAAAAABBAAABBBBABABAABBA
 * 　　ABBBBBABBAABABAAABBBABBAA
 * 　　ABAAABABABBBAAAAAAAAAABAA
 * 　　ABAAABABABABBBABBAABBABAA
 * 　　ABAAABABBABBABABAABAABAAA
 * 　　ABBBBBABABBBBBABBAAAABAAA
 * 　　AAAAAAABAABBBAABABABBABBA
 * 　请问在这个矩阵中有多少个字母A？
 */
public class Count_A {
    public static void main(String[] args) {
        String str="AAAAAAABABBAABABABAAAAAAA\n" +
                "　　ABBBBBABBAABBBBBABABBBBBA\n" +
                "　　ABAAABABBBABAABBBBABAAABA\n" +
                "　　ABAAABABBBBBAABAABABAAABA\n" +
                "　　ABAAABABBABABBABABABAAABA\n" +
                "　　ABBBBBABBBABAABBBBABBBBBA\n" +
                "　　AAAAAAABABABABABABAAAAAAA\n" +
                "　　BBBBBBBBABAABABBBBBBBBBBB\n" +
                "　　AABAABABBAAABBAAABABBBBBA\n" +
                "　　ABBABABBBABBAAAABBBBAAAAB\n" +
                "　　BBBBAAABABAABABAABBBAABBA\n" +
                "　　BBAABABABAAAABBBAABBAAAAA\n" +
                "　　ABABBBABAABAABABABABBBBBA\n" +
                "　　AAAABBBBBABBBBAAABBBABBAB\n" +
                "　　AABAABAAABAAABAABABABAAAA\n" +
                "　　ABBBBBBBBABABBBBABAABBABA\n" +
                "　　ABBBAAABAAABBBAAAAAAABAAB\n" +
                "　　BBBBBBBBABBAAABAABBBABBAB\n" +
                "　　AAAAAAABBAAABBBBABABAABBA\n" +
                "　　ABBBBBABBAABABAAABBBABBAA\n" +
                "　　ABAAABABABBBAAAAAAAAAABAA\n" +
                "　　ABAAABABABABBBABBAABBABAA\n" +
                "　　ABAAABABBABBABABAABAABAAA\n" +
                "　　ABBBBBABABBBBBABBAAAABAAA\n" +
                "　　AAAAAAABAABBBAABABABBABBA";
        int total=0;
        for(int i=0;i<str.length();i++){
            if(str.charAt(i)=='A')
                total++;
        }
        System.out.println(total);
    }

}
